home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 40
/
Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso
/
Aminet
/
util
/
cdity
/
ModeProSrc.lha
/
Prefs
/
MPNeuGadgets.c
< prev
next >
Wrap
C/C++ Source or Header
|
1998-12-24
|
64KB
|
1,279 lines
#include "mppexterns.h"
#include <extras/macros/intuition.h>
#include <extras/layoutgt.h>
#include <clib/extras_protos.h>
#include <libraries/gadtools.h>
#include <intuition/gadgetclass.h>
struct LG_Control *GadControl,*PGad2GadControl,*BackdropControl[3]={0};
extern float XScale,YScale,PXScale,PYScale;
struct Hook StrHook,PenLVHook,StrCursorHook,PromotionLVHook;
extern UBYTE *CenterLabels[],*SFontLabels[],*OverscanLabels[],*ModeSelLabels[],*ListLabels[];
extern struct TextFont *GUIFont;
extern struct TextArea ColorDisp, PenNameDisp, FontDisp;
extern struct Window *Win;
extern struct MPMessage *ForcedEditMsg;
extern struct TextAttr Topaz8;
#define UseString(x) x
WORD WindowWidth=620,WindowHeight=266;
struct IBox GadgetArea[TOTAL_AREAS];
struct List OptionList;
STRPTR G_PLIST, G_SELECT_NAME, G_NEW, G_REMOVE, G_ENTRIES, G_UK_NEW_ENTRY, G_UK_ENTRY_TYPE, G_PROMOTION, G_SELECT_SCREEN_MODE,
G_OVERSCAN, G_WIDTH, G_HEIGHT, G_COLORS, G_PALETTE, G_COLOR_SLIDER, G_EDIT_PALETTE, G_AUTOSCROLL, G_INTERLEAVE, G_BEHIND,
G_BLANK_BORDER, G_FORCE_PLANAR, G_CENTER, G_3D_LOOK, G_3D_DEFAULT, G_3D_RESET, G_FONT, G_FONT_SELECT, G_FONT_FIX_ASPECT,
G_SHARE_PENS, G_SP_EXCLUDE, G_MAKE_PUBLIC, G_PUB_NAME, G_DO_HOTKEY, G_HOTKEY, G_SAVE, G_USE, G_CANCEL, G_UK_USE_DELETE,
G_UK_USE,G_UK_NEVER_AGAIN, G_UK_CANCEL, G_BACKDROP, G_BACKDROPFILE,G_BACKDROPCENTER,G_BACKDROP_COLOR;
STRPTR BackdropLabels[]=
{
(STRPTR)MSG_G_BACKDROP_OPT_NONE,
(STRPTR)MSG_G_BACKDROP_OPT_PICTURE,
(STRPTR)MSG_G_BACKDROP_OPT_COLOR,
0
};
UBYTE BackdropColorTable;
STRPTR ForcedEditLabels[]=
{
(STRPTR)MSG_G_SCREEN_NAMES,
(STRPTR)MSG_G_PROGRAM_NAMES,
(STRPTR)MSG_G_SCREEN_MODES,
0
};
struct LG_Control *MakeMPPGadgets(struct Window *Window, APTR VisualInfo, struct TextAttr *TA)
{
// WORD MaxPGadWidth;
LONG l,ww,wh,feditspace;
float xs;
// char colorkeys[5],*colorstr;
/*
struct IBox ibox[]={
{7, 4, 194, -25}, // list
{212, 4, 232, 91}, // promm
{212, 101, 232, -179}, // opt
{455, 4, 169, -164}, // td
{212, -72, 232, 51}, // font
{455, -109, 169, 26}, // shrp **
{455, -77, 169, 25}, // pub **
{455, -46, 169, 25}, // hotk **
{455, -154, 169, 38}, // backdrp **
{7, -15, 617, 12} // pgad
};
*/
struct IBox ibox[]={
{0, 0, 202, -20}, // list
{202, 0, 240, 100}, // promm
{202, 100, 240, -80}, // opt
{442, 0, 178, -168}, // td
{202, -80, 240, 60}, // font
{442, -122, 178, 34}, // shrp **
{442, -88, 178, 34}, // pub **
{442, -54, 178, 34}, // hotk **
{442, -168, 178, 46}, // backdrp 46**
{0, -20, 620, 20} // pgad
};
/*
struct IBox ibox[]={
{8, 4, 194, -28}, // list
{212, 4, 232, 91}, // promm
{212, 101, 232, -179}, // opt
{455, 4, 169, -164}, // td
{212, -72, 232, 51}, // font
{455, -109, 169, 26}, // shrp **
{455, -77, 169, 26}, // pub **
{455, -46, 169, 26}, // hotk **
{455, -154, 169, 38}, // backdrp **
{8, -20, 617, 12} // pgad
};
*/
/*
if(GetWinInnerWidth(Window) < WindowWidth * PXScale ||
GetWinInnerHeight(Window) < WindowHeight * PYScale )
{
TA=&Topaz8;
XScale=1;
YScale=1;
}
else
{
XScale=PXScale;
YScale=PYScale;
}
*/
ww=((float)GetWinInnerWidth(Window)/XScale);
wh=((float)GetWinInnerHeight(Window)/YScale);
xs=(float)ww/(float)WindowWidth;
/*
colorstr=GetString(MSG_G_COLOR_SLIDER);
colorkeys[0]=KeyUnshifted(colorstr[1]);
colorkeys[1]=KeyUnshifted(colorstr[0]);
colorkeys[2]=KeyShifted(colorstr[1]);
colorkeys[3]=KeyShifted(colorstr[0]);
colorkeys[4]=0;
printf("%s - %s\n",colorstr,colorkeys);
*/
for(l=0;l<TOTAL_AREAS;l++)
{
GadgetArea[l].Left =ibox[l].Left *xs + 4;
GadgetArea[l].Width =ibox[l].Width *xs - 8;
GadgetArea[l].Top= (ibox[l].Top<0 ? ibox[l].Top +=wh : ibox[l].Top) + 4;
GadgetArea[l].Height= (ibox[l].Height<0 ? ibox[l].Height+=wh-ibox[l].Top : ibox[l].Height) - 8;
}
feditspace=(GadgetArea[PGAD_AREA].Width-128)/3;
if(GadControl=LG_CreateGadgets( /* init shit */
LG_VisualInfo ,VisualInfo,
LG_UseWindowOffsets ,Window,
LG_EraseRemoved ,FALSE,
LG_TextAttr ,TA,
LG_ScaleX ,(ULONG)(XScale * 65535),
LG_ScaleY ,(ULONG)(YScale * 65535),
/* List gadget offsets */
LG_Bounds ,&GadgetArea[LIST_AREA],
LG_SkipGadgets ,(ForcedEditMsg ? 7 : 0),
/* List type */
LG_LeftEdge ,0,
LG_TopEdge ,0,
LG_Width ,LG_REL_WIDTH(0),
LG_Height ,12,
LG_GadgetText ,/* UseString */(G_PLIST),
LG_GadgetID ,GD_TYPE,
LG_Flags ,PLACETEXT_LEFT,
LG_LabelFlags ,LGLF_FITLABEL,
LG_GadgetKind ,CYCLE_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCY_Labels ,&ListLabels[0],
LG_CreateGadget ,0,
/* SELECT_NAME */
LG_TopEdge ,LG_REL_BOTTOM(-12),
LG_GadgetText ,/* UseString */(G_SELECT_NAME),
LG_GadgetID ,GD_SELECT_NAME,
LG_Flags ,PLACETEXT_IN,
LG_LabelFlags ,0,
LG_GadgetKind ,BUTTON_KIND,
LG_GadgetTags ,1,
GT_Underscore ,'_',
LG_CreateGadget ,0,
/* New */
LG_HorizCells ,2,
LG_RelHorizGap ,2,
LG_LeftEdge ,LG_REL_CELL_LEFTEDGE(0),
LG_TopEdge ,LG_REL_BOTTOM(-25),
LG_Width ,LG_REL_CELL_WIDTH(1),
LG_GadgetText ,/* UseString */(G_NEW),
LG_GadgetID ,GD_NEW,
LG_CreateGadget ,0,
/* Remove */
LG_LeftEdge ,LG_REL_CELL_LEFTEDGE(1),
LG_GadgetText ,/* UseString */(G_REMOVE),
LG_GadgetID ,GD_REMOVE,
LG_CreateGadget ,0,
/* Entry Name */
LG_LeftEdge ,0,
LG_TopEdge ,LG_REL_BOTTOM(-38),
LG_Width ,LG_REL_WIDTH(-18),
LG_GadgetText ,0,
LG_GadgetID ,GD_NAME,
LG_GadgetKind ,STRING_KIND,
LG_GadgetTags ,2,
GTIN_EditHook ,&StrCursorHook,
GTST_MaxChars ,256,
LG_CreateGadget , 0,
/* List */
LG_TopEdge ,29,
LG_Height ,LG_REL_HEIGHT(-55),
LG_GadgetText ,/* UseString */(G_ENTRIES),
LG_Flags ,PLACETEXT_ABOVE,
LG_GadgetID ,GD_LIST,
LG_GadgetKind ,LISTVIEW_KIND,
LG_GadgetTags ,5,
GT_Underscore ,'_',
GTLV_ShowSelected ,GD_NAME,
GTLV_ScrollWidth ,(ULONG)(18 * XScale),
GTLV_CallBack ,&PromotionLVHook,
LAYOUTA_Spacing ,1,
LG_CreateGadget ,0,
/* Move */
LG_LeftEdge ,LG_REL_RIGHT(-18),
LG_Width ,18,
LG_GadgetID ,GD_MOVE,
LG_GadgetKind ,SLIDER_KIND,
LG_GadgetText ,0,
LG_GadgetTags ,5,
GT_Underscore ,'_',
PGA_Freedom ,LORIENT_VERT,
GTSL_Min ,0,
GTSL_Max ,0,
GTSL_Level ,0,
LG_CreateGadget ,0,
/* End of list gadgets */
LG_SkipGadgets ,(ForcedEditMsg ? 0 : 2),
LG_LeftEdge ,0,
LG_TopEdge ,13,
LG_Width ,LG_REL_WIDTH(0),
LG_Height ,12,
LG_GadgetText ,/* UseString */(G_UK_NEW_ENTRY),
LG_GadgetID ,GD_FE_ENTRY_NAME,
LG_Flags ,PLACETEXT_ABOVE,
LG_GadgetKind ,TEXT_KIND,
LG_GadgetTags ,3,
GTTX_Border ,1,
GTTX_Justification ,GTJ_CENTER,
GTTX_Clipped ,1,
LG_CreateGadget ,0,
LG_TopEdge ,39,
LG_GadgetText ,/* UseString */(G_UK_ENTRY_TYPE),
LG_GadgetID ,GD_FE_ENTRY_TYPE,
LG_CreateGadget ,0,
/* Promotion Gads */
LG_Bounds ,&GadgetArea[PROM_AREA],
/* ModeSel */
LG_LeftEdge ,0,
LG_TopEdge ,0,
LG_Width ,LG_REL_WIDTH(0),
LG_Height ,12,
LG_GadgetText ,/* UseString */(G_PROMOTION),
LG_GadgetID ,GD_MODESEL,
LG_Flags ,PLACETEXT_LEFT,
LG_LabelFlags ,LGLF_FITLABEL,
LG_GadgetKind ,CYCLE_KIND,
LG_GadgetTags ,2,
GT_Underscore,'_',
GTCY_Labels, &ModeSelLabels[0],
LG_CreateGadget ,0,
/* SelMode */
LG_TopEdge ,13,
LG_GadgetText ,/* UseString */(G_SELECT_SCREEN_MODE),
LG_GadgetID ,GD_SELMODE,
LG_Flags ,PLACETEXT_IN,
LG_LabelFlags ,0,
LG_GadgetKind ,BUTTON_KIND,
LG_GadgetTags ,1,
GT_Underscore ,'_',
LG_CreateGadget ,0,
/* Screen Mode */
LG_TopEdge ,26,
LG_GadgetText ,0,
LG_GadgetID ,GD_SCREENMODE,
LG_GadgetKind ,TEXT_KIND,
LG_GadgetTags ,2,
GTTX_Border, TRUE,
GTTX_Justification, GTJ_CENTER,// (4.57.10)
LG_CreateGadget ,0,
/* DoOverscan */
/*
LG_LeftEdge ,0,
LG_TopEdge ,39,
LG_Width ,26,
LG_Height ,12,
LG_GadgetText ,0,
LG_GadgetID ,GD_DOOVERSCAN,
LG_Flags ,PLACETEXT_RIGHT,
LG_LabelFlags ,0,
LG_GadgetKind ,CHECKBOX_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCB_Scaled , TRUE,
LG_CreateGadget ,0,
*/
/* Overscan */
/*
LG_LeftEdge ,34,
LG_TopEdge ,39,
LG_Width ,LG_REL_WIDTH(-34),
*/
LG_LeftEdge ,0,
LG_TopEdge ,39,
LG_Width ,LG_REL_WIDTH(0),
LG_GadgetText ,/* UseString */(G_OVERSCAN),
LG_GadgetID ,GD_OVERSCAN,
LG_Flags ,PLACETEXT_LEFT,
LG_LabelFlags ,LGLF_FITLABEL,
LG_GadgetKind ,CYCLE_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCY_Labels, &OverscanLabels[0],
LG_CreateGadget ,0,
LG_HorizCells ,2,
LG_RelHorizGap ,8,
/* Width */
LG_TopEdge ,52,
LG_Width ,LG_REL_CELL_WIDTH(1),
// LG_Width ,GadgetArea[PROM_AREA].Width/2-8,
LG_GadgetText ,/* UseString */(G_WIDTH),
LG_GadgetID ,GD_WIDTH,
LG_GadgetKind ,INTEGER_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTIN_MaxChars, 10,
LG_CreateGadget ,0,
/* Height */
//LG_LeftEdge ,GadgetArea[PROM_AREA].Width/2+8,
LG_LeftEdge ,LG_REL_CELL_LEFTEDGE(1),
LG_GadgetText ,/* UseString */(G_HEIGHT),
LG_GadgetID ,GD_HEIGHT,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTIN_MaxChars, 10,
LG_CreateGadget ,0,
/* Do Depth */
LG_LeftEdge ,0,
LG_TopEdge ,66,
LG_Width ,26,
LG_Height ,12,
LG_GadgetText ,/* UseString */(G_COLORS),
LG_GadgetID ,GD_DODEPTH,
LG_Flags ,PLACETEXT_RIGHT,
LG_LabelFlags ,0,
LG_GadgetKind ,CHECKBOX_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCB_Scaled , TRUE,
LG_CreateGadget ,0,
/* Palette */
LG_TopEdge ,79,
LG_GadgetText ,/* UseString */(G_PALETTE),
LG_GadgetID ,GD_PALETTE,
LG_CreateGadget ,0,
/* Palette II */
/*
LG_TopEdge ,79,
LG_GadgetText ,"Palette:",
LG_GadgetID ,100,
LG_GadgetKind ,CYCLE_KIND,
LG_Flags ,PLACETEXT_LEFT,
LG_LabelFlags ,LGLF_FITLABEL,
LG_Width ,116,
LG_Height ,12,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCY_Labels ,plabels,
LG_CreateGadget ,0,
*/
/* Colors */
LG_LeftEdge ,LG_REL_RIGHT(0),
LG_TopEdge ,66,
LG_Width ,LG_REL_WIDTH(-163),
LG_GadgetText ,/* UseString */(G_COLOR_SLIDER),
LG_GadgetID ,GD_DEPTH,
LG_Flags ,PLACETEXT_RIGHT,
LG_LabelFlags ,LGLF_FITLABEL,
LG_Justification,LG_JUST_RIGHT | LG_JUST_WITHLABEL,
LG_GadgetKind ,SLIDER_KIND,
LG_KeyString ,/* UseString */(G_COLOR_SLIDER),
LG_GadgetTags ,4,
GT_Underscore ,'_',
PGA_Freedom ,LORIENT_HORIZ,
GTSL_Min ,1,
GTSL_Max ,8,
LG_CreateGadget ,0,
/* Edit Pal */
LG_TopEdge ,79,
LG_Width ,LG_REL_WIDTH(-117),
LG_GadgetText ,/* UseString */(G_EDIT_PALETTE),
LG_GadgetID ,GD_EDITPALETTE,
LG_Flags ,PLACETEXT_IN,
LG_GadgetKind ,BUTTON_KIND,
LG_GadgetTags ,1,
GT_Underscore ,'_',
LG_CreateGadget ,0,
LG_Justification,0,
/* Option Gads */
LG_Bounds ,&GadgetArea[OPT_AREA],
/* AutoScroll*/
LG_LeftEdge ,0,
LG_TopEdge ,0,
LG_Width ,26,
LG_Height ,12,
LG_GadgetText ,/* UseString */(G_AUTOSCROLL),
LG_GadgetID ,GD_AUTOSCROLL,
LG_Flags ,PLACETEXT_RIGHT,
LG_LabelFlags ,0,
LG_GadgetKind ,CHECKBOX_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCB_Scaled, TRUE,
LG_CreateGadget ,0,
/* Interleave */
LG_TopEdge ,13,
//LG_LeftEdge ,GadgetArea[OPT_AREA].Width/2,
LG_GadgetText ,/* UseString */(G_INTERLEAVE),
LG_GadgetID ,GD_INTERLEAVE,
LG_CreateGadget ,0,
/* Behind */
LG_TopEdge ,26,
//LG_LeftEdge ,GadgetArea[OPT_AREA].Width/2,
LG_GadgetText ,/* UseString */(G_BEHIND),
LG_GadgetID ,GD_BEHIND,
LG_CreateGadget ,0,
/* Open Blank */
LG_TopEdge ,39,
//LG_LeftEdge ,0,
LG_GadgetText ,/* UseString */(G_BLANK_BORDER),
LG_GadgetID ,GD_BLANK_BORDER,
LG_CreateGadget ,0,
/* Force Planar */
LG_TopEdge ,52,
LG_GadgetText ,/* UseString */(G_FORCE_PLANAR),
LG_GadgetID ,GD_FORCE_PLANAR,
LG_CreateGadget ,0,
/* Center */
LG_LeftEdge ,0,
LG_TopEdge ,65,
LG_Width ,LG_REL_WIDTH(0),
LG_GadgetText ,/* UseString */(G_CENTER),
LG_GadgetID ,GD_CENTER,
LG_Flags ,PLACETEXT_LEFT,
LG_LabelFlags ,LGLF_FITLABEL,
LG_GadgetKind ,CYCLE_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCY_Labels ,&CenterLabels[0],
LG_CreateGadget ,0,
/*
/* Options List*/
LG_TopEdge ,0,
LG_Height ,LG_REL_HEIGHT(-13),
LG_GadgetText ,"_Options (T-oggle)",
LG_GadgetID ,GD_AUTOSCROLL,
LG_Flags ,PLACETEXT_ABOVE,
LG_GadgetKind ,LISTVIEW_KIND,
LG_GadgetTags ,3,
GTLV_ShowSelected ,0,
GT_Underscore ,'_',
GTLV_Labels ,&OptionList,
LG_CreateGadget ,0,
*/
/* End Opt */
/* Begin 3d */
LG_Bounds ,&GadgetArea[TD_AREA],
/* LOOK3D */
LG_LeftEdge ,0,
LG_TopEdge ,0,
LG_Width ,26,
LG_Height ,12,
LG_GadgetText ,/* UseString */(G_3D_LOOK),
LG_GadgetID ,GD_LOOK3D,
LG_Flags ,PLACETEXT_RIGHT,
LG_LabelFlags ,0,
LG_GadgetKind ,CHECKBOX_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCB_Scaled ,TRUE,
LG_CreateGadget ,0,
LG_TopEdge ,13,
LG_GadgetText ,/* UseString */(G_3D_DEFAULT),
LG_GadgetID ,GD_3D_DEFAULT,
LG_CreateGadget ,0,
/* Reset Pens */
LG_TopEdge ,26,
LG_Width ,LG_REL_WIDTH(0),
LG_GadgetText ,/* UseString */(G_3D_RESET),
LG_GadgetID ,GD_RESETPENS,
LG_Flags ,PLACETEXT_IN,
LG_GadgetKind ,BUTTON_KIND,
LG_GadgetTags ,1,
GT_Underscore ,'_',
LG_CreateGadget ,0,
/* PenList */
LG_TopEdge ,39,
LG_Height ,LG_REL_HEIGHT(-52),
LG_GadgetText ,0,
LG_GadgetID ,GD_PENLIST,
LG_GadgetKind ,LISTVIEW_KIND,
LG_GadgetTags ,3,
GT_Underscore ,'_',
GTLV_CallBack ,&PenLVHook,
GTLV_ScrollWidth ,18,
LG_CreateGadget ,0,
/* PenVal */
LG_LeftEdge ,LG_REL_RIGHT(-55),
LG_TopEdge ,LG_REL_BOTTOM(-13),
LG_Width ,55,
LG_Height ,12,
LG_GadgetID ,GD_PENVAL,
LG_GadgetKind ,INTEGER_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTIN_EditHook ,&StrCursorHook,
LG_CreateGadget ,0,
/* Font */
LG_Bounds ,&GadgetArea[FONT_AREA],
/* Font Mode */
LG_LeftEdge ,0,
LG_TopEdge ,0,
LG_Width ,LG_REL_WIDTH(0),
LG_Height ,12,
LG_GadgetText ,/* UseString */(G_FONT),
LG_GadgetID ,GD_SFONT,
LG_Flags ,PLACETEXT_LEFT,
LG_LabelFlags ,LGLF_FITLABEL,
LG_GadgetKind ,CYCLE_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCY_Labels ,&SFontLabels[0],
LG_CreateGadget ,0,
/* Pick font */
LG_TopEdge ,13,
LG_GadgetText ,/* UseString */(G_FONT_SELECT),
LG_GadgetID ,GD_PICKFONT,
LG_Flags ,PLACETEXT_IN,
LG_LabelFlags ,0,
LG_GadgetKind ,BUTTON_KIND,
LG_GadgetTags ,1,
GT_Underscore ,'_',
LG_CreateGadget ,0,
/* Fix Aspect */
LG_TopEdge ,39,
LG_Width ,26,
LG_GadgetText ,/* UseString */(G_FONT_FIX_ASPECT),
LG_GadgetID ,GD_FASPECT,
LG_Flags ,PLACETEXT_RIGHT,
LG_GadgetKind ,CHECKBOX_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCB_Scaled ,TRUE,
LG_CreateGadget ,0,
/* End font */
/* Begin Share pens */
LG_Bounds ,&GadgetArea[SHPN_AREA],
/* Share Pens */
LG_LeftEdge ,0,
LG_TopEdge ,0,
LG_Width ,26,
LG_Height ,12,
LG_GadgetText ,/* UseString */(G_SHARE_PENS),
LG_GadgetID ,GD_SHAREPENS,
LG_Flags ,PLACETEXT_RIGHT,
LG_LabelFlags ,0,
LG_GadgetKind ,CHECKBOX_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCB_Scaled ,TRUE,
LG_CreateGadget ,0,
/* Exclude */
LG_TopEdge ,14,
LG_Width ,LG_REL_WIDTH(0),
LG_GadgetText ,/* UseString */(G_SP_EXCLUDE),
LG_GadgetID ,GD_LOCKEDPENS,
LG_Flags ,PLACETEXT_LEFT,
LG_LabelFlags ,LGLF_FITLABEL,
LG_GadgetKind ,STRING_KIND,
LG_GadgetTags ,3,
GT_Underscore ,'_',
GTST_EditHook ,&StrHook,
GTST_MaxChars ,256,
LG_CreateGadget ,0,
/* End share */
/* Begin Public */
LG_Bounds ,&GadgetArea[PUB_AREA],
/* Make Public */
LG_LeftEdge ,0,
LG_TopEdge ,0,
LG_Width ,26,
LG_Height ,12,
LG_GadgetText ,/* UseString */(G_MAKE_PUBLIC),
LG_GadgetID ,GD_PUBOPT,
LG_Flags ,PLACETEXT_RIGHT,
LG_LabelFlags ,0,
LG_GadgetKind ,CHECKBOX_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCB_Scaled ,TRUE,
LG_CreateGadget ,0,
/* Pub Name */
LG_TopEdge ,13,
LG_Width ,LG_REL_WIDTH(0),
LG_GadgetText ,/* UseString */(G_PUB_NAME),
LG_GadgetID ,GD_PUBNAME,
LG_Flags ,PLACETEXT_LEFT,
LG_LabelFlags ,LGLF_FITLABEL,
LG_GadgetKind ,STRING_KIND,
LG_GadgetTags ,1,
GT_Underscore ,'_',
GTST_MaxChars ,MAXPUBSCREENNAME+1,
LG_CreateGadget ,0,
/* End Pub */
/* Begin HotKey */
LG_Bounds ,&GadgetArea[HOTK_AREA],
/* Do HotKey */
LG_LeftEdge ,0,
LG_TopEdge ,0,
LG_Width ,26,
LG_Height ,12,
LG_GadgetText ,/* UseString */(G_DO_HOTKEY),
LG_GadgetID ,GD_HOTKEYOPT,
LG_Flags ,PLACETEXT_RIGHT,
LG_LabelFlags ,0,
LG_GadgetKind ,CHECKBOX_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCB_Scaled ,TRUE,
LG_CreateGadget ,0,
/* HotKey Str */
LG_TopEdge ,13,
LG_Width ,LG_REL_WIDTH(0),
LG_GadgetText ,/* UseString */(G_HOTKEY),
LG_GadgetID ,GD_HOTKEYSTR,
LG_Flags ,PLACETEXT_LEFT,
LG_LabelFlags ,LGLF_FITLABEL,
LG_GadgetKind ,STRING_KIND,
LG_GadgetTags ,1,
GT_Underscore ,'_',
LG_CreateGadget ,0,
/* End HK */
/* Begin Backdrop */
LG_Bounds ,&GadgetArea[BACKDROP_AREA],
/*/* Do BD */
LG_LeftEdge ,0,
LG_TopEdge ,0,
LG_Width ,26,
LG_Height ,12,
LG_GadgetText ,(G_BACKDROP),
LG_GadgetID ,GD_BACKDROPOPT,
LG_Flags ,PLACETEXT_RIGHT,
LG_LabelFlags ,0,
LG_GadgetKind ,CHECKBOX_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCB_Scaled ,TRUE,
LG_CreateGadget ,0,*/
/* Do BD */
LG_LeftEdge ,0,
LG_TopEdge ,0,
LG_Width ,LG_REL_WIDTH(0),
LG_Height ,12,
LG_GadgetText ,(G_BACKDROP),
LG_GadgetID ,GD_BACKDROPOPT,
LG_Flags ,PLACETEXT_LEFT,
LG_LabelFlags ,LGLF_FITLABEL,
LG_GadgetKind ,CYCLE_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCY_Labels ,BackdropLabels,
LG_CreateGadget ,0,
/*
/* Backdrop File */
LG_TopEdge ,13,
LG_Width ,50,
LG_GadgetText ,(G_BACKDROPFILE),
LG_GadgetID ,GD_BACKDROPPICK,
LG_Flags ,PLACETEXT_IN,
LG_LabelFlags ,LGLF_FITLABEL,
LG_GadgetKind ,BUTTON_KIND,
LG_GadgetTags ,1,
GT_Underscore ,'_',
LG_CreateGadget ,0,
LG_TopEdge ,26,
LG_Width ,26,
LG_GadgetText ,(G_BACKDROPCENTER),
LG_GadgetID ,GD_BACKDROPCENTER,
LG_Flags ,PLACETEXT_RIGHT,
LG_LabelFlags ,0,
LG_GadgetKind ,CHECKBOX_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCB_Scaled ,TRUE,
LG_CreateGadget ,0,
/* Backdrop Filename */
LG_TopEdge ,13,
LG_LeftEdge ,51,
LG_Width ,LG_REL_WIDTH(-51),
LG_GadgetText ,0,
LG_GadgetID ,GD_BACKDROPFILENAME,
LG_GadgetKind ,TEXT_KIND,
LG_GadgetTags ,2,
GTTX_Border ,1,
GTTX_Clipped ,1,
LG_CreateGadget ,0,
/* End BD */
*/
/* Begin SUC */
LG_Bounds ,&GadgetArea[PGAD_AREA],
LG_SkipGadgets ,(ForcedEditMsg?3:0),
/* Save */
LG_LeftEdge ,0,
LG_TopEdge ,0,
LG_Width ,87,
LG_Height ,12,
LG_GadgetText ,/* UseString */(G_SAVE),
LG_GadgetID ,GD_SAVE,
LG_Flags ,PLACETEXT_IN,
LG_LabelFlags ,0,
LG_GadgetKind ,BUTTON_KIND,
LG_CreateGadget ,0,
/* Use */
LG_LeftEdge ,GadgetArea[PGAD_AREA].Width/2,
LG_GadgetText ,/* UseString */(G_USE),
LG_GadgetID ,GD_USE,
LG_Justification,LG_JUST_HCENTER,
LG_CreateGadget ,0,
/* Cancel */
LG_LeftEdge ,LG_REL_RIGHT(-87),
LG_GadgetText ,/* UseString */(G_CANCEL),
LG_GadgetID ,GD_CANCEL,
LG_Justification,LG_JUST_LEFT,
LG_CreateGadget ,0,
LG_SkipGadgets ,(ForcedEditMsg?0:4),
/* */
LG_Justification,LG_JUST_LEFT,
LG_LeftEdge ,0,
LG_TopEdge ,0,
LG_Width ,128,
LG_Height ,12,
LG_GadgetText ,/* UseString */(G_UK_USE),
LG_GadgetID ,GD_FE_SAVEUSE,
LG_Flags ,PLACETEXT_IN,
LG_LabelFlags ,0,
LG_GadgetKind ,BUTTON_KIND,
LG_CreateGadget ,0,
/* Use */
LG_LeftEdge ,feditspace * 1,
LG_GadgetText ,/* UseString */(G_UK_USE_DELETE),
LG_GadgetID ,GD_FE_USEDELETE,
LG_CreateGadget ,0,
/* Cancel */
LG_LeftEdge ,feditspace * 2,
LG_GadgetText ,/* UseString */(G_UK_NEVER_AGAIN),
LG_GadgetID ,GD_FE_NEVER,
LG_CreateGadget ,0,
/* Cancel */
LG_LeftEdge ,feditspace * 3,
LG_GadgetText ,/* UseString */(G_UK_CANCEL),
LG_GadgetID ,GD_FE_CANCEL,
LG_CreateGadget ,0,
TAG_DONE))
{
if(BackdropControl[1]=LG_CreateGadgets(
LG_VisualInfo ,VisualInfo,
LG_UseWindowOffsets ,Window,
LG_EraseRemoved ,TRUE,
LG_TextAttr ,TA,
LG_ScaleX ,(ULONG)(XScale * 65535),
LG_ScaleY ,(ULONG)(YScale * 65535),
LG_Bounds ,&GadgetArea[BACKDROP_AREA],
LG_LeftEdge ,0,
LG_Height ,12,
/* Backdrop File */
LG_TopEdge ,13,
LG_Width ,50,
LG_GadgetText ,(G_BACKDROPFILE),
LG_GadgetID ,GD_BACKDROPPICK,
LG_Flags ,PLACETEXT_IN,
LG_LabelFlags ,LGLF_FITLABEL,
LG_GadgetKind ,BUTTON_KIND,
LG_GadgetTags ,1,
GT_Underscore ,'_',
LG_CreateGadget ,0,
LG_TopEdge ,26,
LG_Width ,26,
LG_GadgetText ,(G_BACKDROPCENTER),
LG_GadgetID ,GD_BACKDROPCENTER,
LG_Flags ,PLACETEXT_RIGHT,
LG_LabelFlags ,0,
LG_GadgetKind ,CHECKBOX_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCB_Scaled ,TRUE,
LG_CreateGadget ,0,
/* Backdrop Filename */
LG_TopEdge ,13,
LG_LeftEdge ,51,
LG_Width ,LG_REL_WIDTH(-51),
LG_GadgetText ,0,
LG_GadgetID ,GD_BACKDROPFILENAME,
LG_GadgetKind ,TEXT_KIND,
LG_GadgetTags ,2,
GTTX_Border ,1,
GTTX_Clipped ,1,
LG_CreateGadget ,0,
TAG_DONE))
{
LG_AddLGControl(GadControl,BackdropControl[1]);
//printf("BackdropControl[1]\n");
BackdropColorTable=BackdropPen;
if(BackdropControl[2]=LG_CreateGadgets(
LG_VisualInfo ,VisualInfo,
LG_UseWindowOffsets ,Window,
LG_EraseRemoved ,TRUE,
LG_TextAttr ,TA,
LG_ScaleX ,(ULONG)(XScale * 65535),
LG_ScaleY ,(ULONG)(YScale * 65535),
LG_Bounds ,&GadgetArea[BACKDROP_AREA],
LG_LeftEdge ,0,
LG_Height ,26,
/* Backdrop File */
LG_TopEdge ,13,
LG_Width ,LG_REL_WIDTH(0),
LG_GadgetText ,G_BACKDROP_COLOR,
LG_GadgetID ,GD_BACKDROPCOLOR,
LG_Flags ,PLACETEXT_ABOVE,
LG_LabelFlags ,LGLF_FITLABEL,
LG_GadgetKind ,PALETTE_KIND,
LG_GadgetTags ,3,
GT_Underscore, '_',
GTPA_NumColors, 1,
GTPA_ColorTable, &BackdropColorTable,
LG_CreateGadget ,0,
TAG_DONE))
{
LG_AddLGControl(GadControl,BackdropControl[2]);
//printf("BackdropControl[2]\n");
}
}
}
ColorDisp.LeftEdge =GadgetArea[PROM_AREA].Left+106;
ColorDisp.TopEdge =GadgetArea[PROM_AREA].Top+66;
ColorDisp.Width =49;
ColorDisp.Height =12;
PenNameDisp.LeftEdge =GadgetArea[TD_AREA].Left;
PenNameDisp.TopEdge =GadgetArea[TD_AREA].Top+GadgetArea[TD_AREA].Height-13;
PenNameDisp.Width =GadgetArea[TD_AREA].Width-61;
PenNameDisp.Height =12;
FontDisp.LeftEdge =GadgetArea[FONT_AREA].Left;
FontDisp.TopEdge =GadgetArea[FONT_AREA].Top+26;
FontDisp.Width =GadgetArea[FONT_AREA].Width;
FontDisp.Height =12;
SetupTextArea(&ColorDisp);
SetupTextArea(&PenNameDisp);
SetupTextArea(&FontDisp);
return(GadControl);
}
void FreeMPPGadgets(void)
{
LG_FreeGadgets(GadControl);
GadControl=0;
BackdropControl[1]=0;
BackdropControl[2]=0;
}
void SetupTextArea(struct TextArea *TA)
{
TA->LeftEdge = TA->LeftEdge * XScale+Win->BorderLeft;
TA->Width *= XScale;
TA->TopEdge = TA->TopEdge * YScale+Win->BorderTop;
TA->Height *= YScale;
TA->RightEdge = TA->Width + TA->LeftEdge;
TA->BottomEdge = TA->Height + TA->TopEdge;
TA->Baseline=(TA->BottomEdge - TA->TopEdge - GUIFont->tf_YSize)/2
+ GUIFont->tf_Baseline + TA->TopEdge;
}
BOOL GadgetInit(void)
{
G_PLIST = GetString(MSG_G_PLIST);
G_SELECT_NAME = GetString(MSG_G_SELECT_NAME);
G_NEW = GetString(MSG_G_NEW);
G_REMOVE = GetString(MSG_G_REMOVE);
G_ENTRIES = GetString(MSG_G_ENTRIES);
G_UK_NEW_ENTRY = GetString(MSG_G_UK_NEW_ENTRY);
G_UK_ENTRY_TYPE = GetString(MSG_G_UK_ENTRY_TYPE);
G_PROMOTION = GetString(MSG_G_PROMOTION);
G_SELECT_SCREEN_MODE = GetString(MSG_G_SELECT_SCREEN_MODE);
G_OVERSCAN = GetString(MSG_G_OVERSCAN);
G_WIDTH = GetString(MSG_G_WIDTH);
G_HEIGHT = GetString(MSG_G_HEIGHT);
G_COLORS = GetString(MSG_G_COLORS);
G_PALETTE = GetString(MSG_G_PALETTE);
G_COLOR_SLIDER = GetString(MSG_G_COLOR_SLIDER);
G_EDIT_PALETTE = GetString(MSG_G_EDIT_PALETTE);
G_AUTOSCROLL = GetString(MSG_G_AUTOSCROLL);
G_INTERLEAVE = GetString(MSG_G_INTERLEAVE);
G_BEHIND = GetString(MSG_G_BEHIND);
G_BLANK_BORDER = GetString(MSG_G_BLANK_BORDER);
G_FORCE_PLANAR = GetString(MSG_G_FORCE_PLANAR);
G_CENTER = GetString(MSG_G_CENTER);
G_3D_LOOK = GetString(MSG_G_3D_LOOK);
G_3D_DEFAULT = GetString(MSG_G_3D_DEFAULT);
G_3D_RESET = GetString(MSG_G_3D_RESET);
G_FONT = GetString(MSG_G_FONT);
G_FONT_SELECT = GetString(MSG_G_FONT_SELECT);
G_FONT_FIX_ASPECT = GetString(MSG_G_FONT_FIX_ASPECT);
G_SHARE_PENS = GetString(MSG_G_SHARE_PENS);
G_SP_EXCLUDE = GetString(MSG_G_SP_EXCLUDE);
G_MAKE_PUBLIC = GetString(MSG_G_MAKE_PUBLIC);
G_PUB_NAME = GetString(MSG_G_PUB_NAME);
G_DO_HOTKEY = GetString(MSG_G_DO_HOTKEY);
G_HOTKEY = GetString(MSG_G_HOTKEY);
G_SAVE = GetString(MSG_G_SAVE);
G_USE = GetString(MSG_G_USE);
G_CANCEL = GetString(MSG_G_CANCEL);
G_UK_USE_DELETE = GetString(MSG_G_UK_USE_DELETE);
G_UK_USE = GetString(MSG_G_UK_USE);
G_UK_NEVER_AGAIN = GetString(MSG_G_UK_NEVER_AGAIN);
G_UK_CANCEL = GetString(MSG_G_UK_CANCEL);
G_BACKDROP = GetString(MSG_G_BACKDROP);
G_BACKDROPFILE = GetString(MSG_G_BACKDROPFILE);
G_BACKDROPCENTER = GetString(MSG_G_BACKDROPCENTER);
G_BACKDROP_COLOR = GetString(MSG_G_BACKDROP_COLOR);
/*
struct Node *n;
STRPTR optname;
ULONG l;
struct OItem
{
ULONG NameID;
BYTE FlagBit;
} oi[]=
{
{ MSG_G_AUTOSCROLL), 2},
{ MSG_G_BLANK_BORDER), 3},
{ MSG_G_BEHIND), 4},
{ MSG_G_FORCE_PLANAR, 5},
{ MSG_G_INTERLEAVE, 6},
{ -1,-1}
};
NewList(&OptionList);
for(l=0;oi[l].NameID!=-1;l++)
{
if(n=AllocVec(sizeof(struct Node),MEMF_PUBLIC))
{
optname=/* UseString */(oi[l].NameID);
if(n->ln_Name=AllocVec(strlen(optname)+2,MEMF_PUBLIC))
{
n->ln_Name[0]=' ';
n->ln_Pri=oi[l].FlagBit;
strcpy(&n->ln_Name[1],optname);
EnqueueName(&OptionList,n);
}
else
{
FreeVec(n);
}
}
}
*/
return(1);
}
void GadgetCleanup(void)
{
/*
struct Node *n;
while(n=RemHead(&OptionList))
{
FreeVec(n->ln_Name);
FreeVec(n);
}
*/
}
/*
if(ForcedControl=LG_CreateGadgets( /* init shit */
LG_VisualInfo ,VisualInfo,
LG_UseWindowOffsets ,Window,
LG_EraseRemoved ,FALSE,
LG_TextAttr ,TA,
LG_ScaleX ,(ULONG)(XScale * 65535),
LG_ScaleY ,(ULONG)(YScale * 65535),
/* List gadget offsets */
LG_Bounds ,&GadgetArea[LIST_AREA],
LG_LeftEdge ,0,
LG_TopEdge ,12,
LG_Width ,LG_REL_WIDTH(0),
LG_Height ,12,
LG_GadgetText ,GetString(MSG_G_UK_NEW_ENTRY),
LG_GadgetID ,GD_FE_ENTRY_NAME,
LG_Flags ,PLACETEXT_ABOVE,
LG_GadgetKind ,TEXT_KIND,
LG_GadgetTags ,3,
GTTX_Border ,1,
GTTX_Justification ,GTJ_CENTER,
GTTX_Clipped ,1,
LG_CreateGadget ,0,
/* ScreenName Check Box */
LG_TopEdge ,25,
LG_Width ,26,
LG_Height ,12,
LG_GadgetText ,GetString(MSG_G_SCREEN_NAMES),
LG_GadgetID ,GD_FE_USE_SCREENNAME,
LG_Flags ,PLACETEXT_RIGHT,
LG_LabelFlags ,0,
LG_GadgetKind ,CHECKBOX_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCB_Scaled ,TRUE,
LG_CreateGadget ,0,
/* Screen Name Display */
LG_TopEdge ,38,
LG_GadgetText ,0,
LG_GadgetID ,GD_FE_SCREENNAME_DISP,
LG_GadgetKind ,TEXT_KIND,
LG_GadgetTags ,3,
GTTX_Border ,1,
GTTX_Justification ,GTJ_LEFT,
GTTX_Clipped ,1,
LG_CreateGadget ,0,
/* ProgName Check Box */
LG_TopEdge ,51,
LG_Width ,26,
LG_Height ,12,
LG_GadgetText ,GetString(MSG_G_PROGRAM_NAMES),
LG_GadgetID ,GD_FE_USE_PROGRAMNAME,
LG_Flags ,PLACETEXT_RIGHT,
LG_LabelFlags ,0,
LG_GadgetKind ,CHECKBOX_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCB_Scaled ,TRUE,
LG_CreateGadget ,0,
/* Screen Name Display */
LG_TopEdge ,64,
LG_GadgetText ,0,
LG_GadgetID ,GD_FE_PROGRAMNAME_DISP,
LG_GadgetKind ,TEXT_KIND,
LG_GadgetTags ,3,
GTTX_Border ,1,
GTTX_Justification ,GTJ_LEFT,
GTTX_Clipped ,1,
LG_CreateGadget ,0,
/* ScreenMode Check Box */
LG_TopEdge ,77,
LG_Width ,26,
LG_Height ,12,
LG_GadgetText ,GetString(MSG_G_SCREEN_MODES),
LG_GadgetID ,GD_FE_USE_SCREENMODE,
LG_Flags ,PLACETEXT_RIGHT,
LG_LabelFlags ,0,
LG_GadgetKind ,CHECKBOX_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCB_Scaled ,TRUE,
LG_CreateGadget ,0,
/* Screen Name Display */
LG_TopEdge ,90,
LG_GadgetText ,0,
LG_GadgetID ,GD_FE_SCREENMODE_DISP,
LG_GadgetKind ,TEXT_KIND,
LG_GadgetTags ,3,
GTTX_Border ,1,
GTTX_Justification ,GTJ_LEFT,
GTTX_Clipped ,1,
LG_CreateGadget ,0,
*/
/*
LG_LeftEdge ,0,
LG_TopEdge ,12,
LG_Width ,LG_REL_WIDTH(0),
LG_Height ,12,
LG_GadgetText ,GetString(MSG_G_UK_NEW_ENTRY),
LG_GadgetID ,GD_FE_ENTRY_NAME,
LG_Flags ,PLACETEXT_ABOVE,
LG_GadgetKind ,TEXT_KIND,
LG_GadgetTags ,3,
GTTX_Border ,1,
GTTX_Justification ,GTJ_CENTER,
GTTX_Clipped ,1,
LG_CreateGadget ,0,
/* ScreenName Check Box */
LG_TopEdge ,25,
LG_Width ,26,
LG_Height ,12,
LG_GadgetText ,GetString(MSG_G_SCREEN_NAMES),
LG_GadgetID ,GD_FE_SCREENNAME,
LG_Flags ,PLACETEXT_RIGHT,
LG_LabelFlags ,0,
LG_GadgetKind ,CHECKBOX_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCB_Scaled ,TRUE,
LG_CreateGadget ,0,
/* Screen Name Display */
LG_TopEdge ,38,
LG_Width ,LG_REL_WIDTH(0),
LG_GadgetText ,0,
LG_GadgetID ,GD_FE_SCREENNAME_DISP,
LG_GadgetKind ,TEXT_KIND,
LG_GadgetTags ,3,
GTTX_Border ,1,
GTTX_Justification ,GTJ_LEFT,
GTTX_Clipped ,1,
LG_CreateGadget ,0,
/* ProgName Check Box */
LG_TopEdge ,51,
LG_Width ,26,
LG_Height ,12,
LG_GadgetText ,GetString(MSG_G_PROGRAM_NAMES),
LG_GadgetID ,GD_FE_PROGRAMNAME,
LG_Flags ,PLACETEXT_RIGHT,
LG_LabelFlags ,0,
LG_GadgetKind ,CHECKBOX_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCB_Scaled ,TRUE,
LG_CreateGadget ,0,
/* ProgName Display */
LG_TopEdge ,64,
LG_Width ,LG_REL_WIDTH(0),
LG_GadgetText ,0,
LG_GadgetID ,GD_FE_PROGRAMNAME_DISP,
LG_GadgetKind ,TEXT_KIND,
LG_GadgetTags ,3,
GTTX_Border ,1,
GTTX_Justification ,GTJ_LEFT,
GTTX_Clipped ,1,
LG_CreateGadget ,0,
/* ScreenMode Check Box */
LG_TopEdge ,77,
LG_Width ,26,
LG_Height ,12,
LG_GadgetText ,GetString(MSG_G_SCREEN_MODES),
LG_GadgetID ,GD_FE_SCREENMODE,
LG_Flags ,PLACETEXT_RIGHT,
LG_LabelFlags ,0,
LG_GadgetKind ,CHECKBOX_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCB_Scaled ,TRUE,
LG_CreateGadget ,0,
/* Screen Mode Display */
LG_TopEdge ,90,
LG_Width ,LG_REL_WIDTH(0),
LG_GadgetText ,0,
LG_GadgetID ,GD_FE_SCREENMODE_DISP,
LG_GadgetKind ,TEXT_KIND,
LG_GadgetTags ,3,
GTTX_Border ,1,
GTTX_Justification ,GTJ_LEFT,
GTTX_Clipped ,1,
LG_CreateGadget ,0,
*/